package com.ruoyi.business.config;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import com.ruoyi.framework.config.properties.DruidProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;


//Configuration注解的类一一是代替ssm中的xml配置文件，以类代替文件
@Configuration//表名此类是是配置工具类，让springboot框架将此类当成配置文件加载
public class DatasourceConfig {




    @Bean
    @ConfigurationProperties(prefix ="spring.datasource.primary" )
    public DataSource juheDatasource39(){
        return DataSourceBuilder.create().build();
    }

    @Bean
    @ConfigurationProperties(prefix ="spring.datasource.secondary")
    public DataSource juheDatasource182(){
        return DataSourceBuilder.create().build();
    }

    @Bean
    @ConfigurationProperties(prefix ="spring.datasource.third")
    public DataSource juheDatasource123(){
        return DataSourceBuilder.create().build();
    }
}
